using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Affirma.ThreeSharp.Wrapper;
using System.Xml;
using System.Text.RegularExpressions;

namespace CloudDrive.S3
{
    public class FileInfo
    {
        public string FileName
        {
            get
            {
                string fileName = FullName;
                if (fileName.EndsWith("\\")) // directory
                    fileName = fileName.Remove(fileName.Length - 1);
                fileName = fileName.Substring(fileName.LastIndexOf("\\") + 1);
                return fileName;
            }
        }
        public string Directory
        {
            get
            {
                string fileName = FullName;
                if (fileName.EndsWith("\\")) // directory
                    fileName = fileName.Remove(fileName.Length - 1);
                return fileName.Substring(0, fileName.LastIndexOf("\\") + 1);
            }
        }
        public string FullName { get; set; }
        public bool IsDirectory
        {
            get
            {
                return FullName.EndsWith("\\");
            }
        }
        public DateTime LastModified
        {
            get;
            set;
        }
        public long Length
        {
            get;
            set;
        }
    }
}
